<admintpl file="header" />
<style type="text/css">
.pic-list li {
	margin-bottom: 5px;
}
</style>
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<!--<li><a href="{:U('AdminRecharge/index')}">充值记录</a></li>-->
			<li class="active"><a href="{:U('AdminRecharge/add',array('id'=>empty($item['id'])?'':$item['id']))}" target="_self">充值</a></li>
		</ul>
		<form action="{:U('AdminRecharge/add_post')}" method="post" class="form-horizontal js-ajax-forms" onsubmit="return check_form();" enctype="multipart/form-data">
			<div class="row-fluid">
				<div class="span9">
					<table class="table table-bordered">

						<!--<tr>-->
							<!--<th>物流公司名称<span class="form-required">*</span></th>-->
							<!--<td>-->
								<!--<select name="rid" id="rid">-->
									<!--<option value="0">请选择</option>-->
									<!--<foreach name="logistics_list" item="litem">-->
										<!--<option value="{$litem['id']}">{$litem.logistics_name}</option>-->
									<!--</foreach>-->
								<!--</select>-->
							<!--</td>-->
						<!--</tr>-->
						<tr>
						<th>物流公司名称<span class="form-required">*</span></th>
						<td>{$item.logistics_name}</td>
						</tr>
						<tr>
						<th>账户余额<span class="form-required">*</span></th>
						<td>{$item.balance}</td>
						</tr>
						<tr>
							<th>充值金额<span class="form-required">*</span></th>
							<td><input type="text" name="price" id="price" value="{$item.price}" style="width: 400px" placeholder="请输入充值金额"><div id="big-price"></div></td>
						</tr>
						<tr>
							<th>赠送金额<span class="form-required">*</span></th>
							<td><input type="text" name="general_price" id="general_price" value="{$item.general_price}" style="width: 400px" placeholder="请输入赠送金额"> </td>
						</tr>
						<tr>
							<th>充值描述</th>
							<td>
							<textarea name="desc" width="400" placeholder="请输入充值描述"></textarea>
							</td>
						</tr>
                    </table>
				</div>

			</div>
			<div class="form-actions">
               <input type="hidden" name="rid" value="{$item.id}"/>
				<button class="btn btn-primary js-ajax-submit" type="submit">提交</button>
				<a class="btn" href="{:U('AdminRecharge/index')}">返回</a>
			</div>
		</form>
	</div>
	<script type="text/javascript" src="__PUBLIC__/js/common.js"></script>
	<script>
		$(function(){
			$('#price').change(function(){
				$('#big-price').text(bigMoney($(this).val()));
			});
		})
		function check_form(){
			var rid = $("#rid").val();
			if(rid == ''){
				alert("请选择物流公司!");return false;
			}
			var price = $("#price").val();
			if(price == ''){
				alert("请选择充值金额!");return false;
			}
			var general_price = $("#general_price").val();
			if(general_price == ''){
				alert("请输入赠送金额!");return false;
			}
			return true;
		}
	</script>
	</body>
</html>